package com.kapcb.assemble.chain;

/**
 * <a>Title: Chain </a>
 * <a>Author: cb <a>
 * <a>Description: 责任链顶级接口 <a>
 *
 * @author cb
 * @version 1.0
 * @date 2024/4/18 5:23 PM
 * @since 1.0
 */
public interface Chain<T extends ChainRequest, R extends ChainResponse> {

    /**
     * 处理责任链逻辑
     *
     * @param request  入参
     * @param response 出参
     */
    void handle(T request, R response);

    /**
     * 是否跳过执行当前责任链
     *
     * @param request  入参
     * @param response 出参
     * @return true 跳过、false 不跳过，默认 true
     */
    default boolean skip(T request, R response) {
        return true;
    }

}
